<template>
  <div class="map">
    <header>
      <div class="header-one">
        <span @click="goback">
          <van-icon name="arrow-left" />
        </span>
        <span>地图找房</span>
        <span>
          <van-icon name="more-o" />
        </span>
      </div>
      <div class="header-two">
        <div class="search">
          <div class="option">
            <span @click="anchor">
              {{this.name}}
              <a-icon type="caret-down" />
            </span>
          </div>
          <div class="input">
            <input type="text" placeholder="请在这里输入区域/商圈" />
            <van-icon name="search" class="icon" />
          </div>
          <span></span>
        </div>
        <div class="hint">
          <div>
            <span>
              <img src="../imges/14.png" alt />
            </span>
            <span class="active">买房</span>
          </div>
          <div>
            <span>
              <img src="../imges/15.png" alt @click="rent()" />
            </span>
            <span>租房</span>
          </div>
        </div>
      </div>
      <div class="header-three">
        <li @click="area">
          区域
          <a-icon type="caret-down" />
        </li>
        <li @click="price">
          价格
          <a-icon type="caret-down" />
        </li>
        <li @click="house">
          户型
          <a-icon type="caret-down" />
        </li>
        <li>
          距离
          <a-icon type="caret-down" />
        </li>
        <li>
          <van-icon name="sort" />
        </li>
      </div>
    </header>
    <main>
      <div class="plat">
        <baidu-map class="map" center="北京">
          <bm-geolocation
            anchor="BMAP_ANCHOR_BOTTOM_RIGHT"
            :showAddressBar="true"
            :autoLocation="true"
          ></bm-geolocation>
        </baidu-map>
      </div>
    </main>
  </div>
</template>

<script>
export default {
  data() {
    return {
      select: "北京",
      option: ["北京", "上海", "滁州", "南京", "杭州", "广东", "重庆", "深圳"]
    };
  },
  created() {
    this.getadd();
  },
  methods: {
    goback() {
      this.$router.go(-1);
    },
    rent() {
      this.$router.push("/mapbuy");
    },
    area() {
      this.$router.push("/area");
    },
    price() {
      this.$router.push("/price");
    },
    house() {
      this.$router.push("/house");
    },
    anchor() {
      this.$router.push("/anchor");
    },
    screen() {
      this.$router.push("/screen");
    },
    getadd(item) {
      this.name = localStorage.getItem("name");
    }
  }
};
</script>

<style scoped>
.map {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
header {
  height: 358px;
  border-bottom: 1px solid #cccccc;
}
.header-one {
  height: 97px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 30px;
  font-size: 22px;
  color: #f3f9ff;
  content: "";
  background: linear-gradient(45deg, #0f7ef4, #1988f6, #34a0fd);
}
.header-two {
  height: 203px;
  border-bottom: 1px solid #bcbcbc;
}
.header-three {
  display: flex;
  height: 59px;
  align-items: center;
  justify-content: space-between;
  padding: 0px 30px;
  color: #999999;
}
.search {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 10px;
  border-bottom: 1px solid #cccccc;
  color: #9b9b9b;
}
.option select {
  background: none;
  border: none;
  outline: none;
}
.option select option {
  background: #82b9f3;
}
.input {
  width: 200px;
  height: 30px;
  border: 1px solid #cccccc;
  display: inline-block;
  background: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.input span {
  color: #929292;
}
.input input {
  border: none;
  background: none;
  outline: none;
}
.input .icon {
  color: #9c9c9c;
  font-weight: bold;
  font-size: 20px;
}
.hint {
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 40px;
}
.hint div {
  text-align: center;
}
.hint div .active {
  color: #ff6d3c;
}
.hint div span {
  display: block;
  font-size: 18px;
  font-weight: 600;
}
.map {
  width: 100%;
  height: 400px;
}
</style>